﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Quality.ServiceReference1;


namespace Quality.BasicData
{
 
   public   partial class yyproducts : Form
   {
      
        public yyproducts()
        {
            InitializeComponent();
            this.dataGridView1.AutoGenerateColumns = false;
        }

        private void querybutton_Click(object sender, EventArgs e)
        {
            DataSet dt = new DataSet();
            
            Service1SoapClient s = new Service1SoapClient();
         
             dt = s.getCinList(keytextBox1.Text.Trim(), "");
             dataGridView1.DataSource = dt.Tables[0];

        }

        public event TransfDelegate TransfEvent;
        private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            string[] d = new string[4];
            //当点击表头部的列时，e.RowIndex==-1
            if (e.RowIndex > -1)
            {
               d[0] = this.dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
               d[1] = this.dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString();
               d[2] = this.dataGridView1.Rows[e.RowIndex].Cells[2].Value.ToString();
               d[3] = this.dataGridView1.Rows[e.RowIndex].Cells[3].Value.ToString();


              TransfEvent(d);
              this.Close();

            }
        }
    }
}
